package com.jxb.myshop.common;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */
public class AlipayConfig  {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000121667758";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCu2wu8wO2Vlu3G9eXc2fTsjCzaSVsKpJKHDsxFDbA0d7J5L+9pWRRuxCiGA7OVT5GGRuIEYHUktbbnz42A5HTmNg04k4uKIloMqRuWz87d04aSIww9TQOU+8QhwrNrikJ/IO8OGTOPStMrUVip8YLQY4fYuY8YBRDLxK7H9DuFUoTIgkuFTZsYQvQPLw+K340++VWyyKLGx5Ulxave/zJ6Uc5V+FM3hLIon2LwbC8lY72it22x/bKE2x18za1zFHU1w+Y2RB7sEepDU7GhEU3coCAeW+FG0SVchz//Esjy5NRm27ikRhOTC+TsTN0Nnlqd539yiCFhp/jXTs+8Em5VAgMBAAECggEAe0hHo0KngGPUrAXtlmQ58pn2ecVkokFcakr9rOY0yRlnxVgNxcofxOUa6Tos4OYj5XeOnaVgkoxoNFK7Ixhwb2vGsJAevzrvIKQOpqtH4FDmPZzmYUYuc1l7dI4xMG5f6gBPbDJKjwojjxQgnlmAcOrr+dsCz92qdPDshmBlot5cFlf0q1wgCm+U48gpjdEL964z4lD4yB3o+7P9vkjOTquOKk1//Y8d6IL9hi1yf+KjiOjdn7H+L4N1mdN6qUJRHzM7boACIgjnHD5/BclrK50LlGOU4yoExEx0hnzunzQwz8TNPDAylI4rPVrApkW4muFdFThtDxUNoBEQmsFpFQKBgQDTwPQ6NpZw9iIaYVQq2C0js/3aD1oJagsKUPFmUNe94jIIDBuX4sMSxCa7liTc+gRRmahrY+dmrZqAaX4vYpaAB6u6s/j9NcPQHo9YO3O8tWIWD4Ll1lgy5lYH+CF3J/CkLpBxyBoGnraDtA4Yto2cUjdWVY3X27EAHGhkPZSjjwKBgQDTZFrA3zI6jqGh6Jkx3P5hwqOdztof2L8VsfseInbsCkhQUetvHlsNfyMjow++G+Xge86LeU8Z+bcGhaldQDGqd2g0+/0tJaR5cPb4JY/SYP+mKKAqPr5NATxPvWdmJaTS3FrqwLqIC1lon8miWxi/7qfjn6ooEAzaEF3CbX/N2wKBgBvnRUeWgeSIyp2nTawHqIsX4M+nTjoHW0UUvXq6FHPVJrqgvdIZ85K5flEhy+HCoGcQVH0yQP/qyH07aYFdAHAGkr6bkKftOcxm+oSp8OphDHfTu3AF+sFaUOPj8qT9AlzgNfCIacWNjId2ZpUjGS4MN3aM95AGRyC4nZj39GpJAoGBAIEzvSRVRuXzd2b2O2v2nqQxyr8RRtBgMaqY9dsdRYJPZpNw/m0UKKK/KkMFzwFrG71w7nTg2DAQKIWb/EA6lCCUiuSXf86wSy7OlKRmkNkM4DQ2cG5hmv6F2s8B/Mi6CVu3wvnoghnUlfkUcLEC7MWioIrHc8C4zqIZjrTfKFYxAoGARa40L8ISgbP+LD0R5tz76s3ky3WrkWgo7JdSSwH898Y2h3zLgk+aVyKGL92O/F0bMasw/YOc2ETkFmhGr8AlUNChACfrEW6HtGO0+BM9fzOxsODErDng8tvYa+Iuz4ElC0DzJUBEf+onrleLalTIBJQUFld5eEQkXS6wMsfuawU=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0KYp9mci1GFp8VzDhv/OBnqt6ay2ZIzVfWLBOyYKOK4pYd+2xfmJ4YdbO0/9ZgjjmXl7msQ2ntWk8MxWnIEXHDEhlnzbvZp9MoSZ3rAS4An+Z8g461f/yU2Pv9kCNsCgTU10EawIXsSnLK1xOM4zcdJHnZQICrAdPDDASElAOQU2PaVA0LT1IiBXQztLbhNq3UQC/nmkrFNkisoqF+Z46XcGInWLRC/v02ZqA/leuff67DK/iRH8Aa11V+a+i04UOt/j7Lo44VaYRTPqowXfzf8Zid2lEeOFZ2oD7TjNGTuOSP+ZxMdGsMduTcGhwAHQLQqgeNhabCcrYPWGxOEvrQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://qia2tz.natappfree.cc/notifyURL";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://qia2tz.natappfree.cc/returnURL";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "E:\\千峰学习\\基础\\jar包\\阿里";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

